<template>
  <div>
    <div class="love">
      <div class="love-hd">
        <span class="icon_love"><i class="iconfont"> &#xe64c;</i>猜你喜欢</span>
      </div>
      <div class="love-bd">
        <ul class="love-items">
          <li v-for="item in loveList" :key="item.id" @click="toDetail">
            <img :src="item.imgUrl" alt="" />
            <div class="intro">
              <p>{{ item.title }}</p>
              <span class="tall"
                ><i class="iconfont">&#xe604;</i>{{ item.comments }}条评论</span
              >
              <p class="l_price">
                <span>￥{{ item.price }}</span
                >起 <span class="where">{{ item.where }}</span>
              </p>
            </div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['loveList'],
  data() {
    return {}
  },
  methods: {
    toDetail() {
      this.$router.push('/detail')
    }
  }
}
</script>

<style lang="less" scoped>
.love {
  margin-top: 0.2rem;
  background-color: white;
  padding: 0 0.2rem;
  padding-top: 0.3rem;
}
.icon_love {
  i {
    color: red;
    padding-right: 0.12rem;
  }
  font-size: 0.45rem;
  font-weight: 600;
}
.love-items {
  li {
    height: 3.5rem;
    display: flex;
    align-items: center;
    border-bottom: 0.02rem solid #ccc;
    &:last-child {
      border-bottom: none;
    }
    img {
      height: 3rem;
      width: 3rem;
    }
    .intro {
      display: inline-block;
      margin-left: 0.6rem;
      margin-top: 0.4rem;
      p:nth-child(1) {
        font-size: 0.44rem;
        font-weight: 600;
        width: 6rem;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
      }
      .tall {
        i {
          color: #ffb436;
          padding-right: 0.2rem;
        }
        display: inline-block;
        margin: 0.3rem 0 0.5rem 0;
        font-size: 0.34rem;
        color: #212121;
      }
      .l_price {
        font-size: 0.39rem;
        display: flex;
        span {
          color: red;
          padding-right: 0.2rem;
        }
        .where {
          font-size: 0.37rem;
          color: #212121;
          line-height: 0.6rem;
          position: absolute;
          right: 0;
        }
      }
    }
  }
}
</style>
